package com.hao.tool.logview.runlog.websocket;

import java.io.Serializable;

/**
 * 日志对象
 *
 * @author Sawyer
 * @date 2018-12-29
 * @since
 */
public class LogMessage implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 用户名
     */
    private String username;

    /**
     * 日志时间,这里为了防止转换出错直接使用字符串格式
     */
    private String logTime;

    /**
     * 线程名称
     */
    private String threadName;

    /**
     * 客户端IP
     */
    private String clientIp;

    /**
     * 类名
     */
    private String className;

    /**
     * 日志级别
     */
    private String level;

    /**
     * 方法名
     */
    private String methodName;

    /**
     * 行号
     */
    private String lineNumber;

    /**
     * 消息
     */
    private String message;

    /**
     * 原内容
     */
    private String source;

    /**
     * 异常信息
     */
    private String exceptionStr;

    public static LogMessage build() {
        return new LogMessage();
    }

    public String getUsername() {
        return username;
    }

    public LogMessage setUsername(String username) {
        this.username = username;
        return this;
    }

    public String getLogTime() {
        return logTime;
    }

    public LogMessage setLogTime(String logTime) {
        this.logTime = logTime;
        return this;
    }

    public String getClientIp() {
        return clientIp;
    }

    public LogMessage setClientIp(String clientIp) {
        this.clientIp = clientIp;
        return this;
    }

    public String getClassName() {
        return className;
    }

    public LogMessage setClassName(String className) {
        this.className = className;
        return this;
    }

    public String getLevel() {
        return level;
    }

    public LogMessage setLevel(String level) {
        this.level = level;
        return this;
    }

    public String getThreadName() {
        return threadName;
    }

    public LogMessage setThreadName(String threadName) {
        this.threadName = threadName;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public LogMessage setMessage(String message) {
        this.message = message;
        return this;
    }

    public String getSource() {
        return source;
    }

    public LogMessage setSource(String source) {
        this.source = source;
        return this;
    }

    public String getExceptionStr() {
        return exceptionStr;
    }

    public LogMessage setExceptionStr(String exceptionStr) {
        this.exceptionStr = exceptionStr;
        return this;
    }

    public String getMethodName() {
        return methodName;
    }

    public LogMessage setMethodName(String methodName) {
        this.methodName = methodName;
        return this;
    }

    public String getLineNumber() {
        return lineNumber;
    }

    public LogMessage setLineNumber(String lineNumber) {
        this.lineNumber = lineNumber;
        return this;
    }

    @Override
    public String toString() {
        return "LogMessage{" +
                "username='" + username + '\'' +
                ", logTime='" + logTime + '\'' +
                ", threadName='" + threadName + '\'' +
                ", clientIp='" + clientIp + '\'' +
                ", className='" + className + '\'' +
                ", level='" + level + '\'' +
                ", methodName='" + methodName + '\'' +
                ", lineNumber='" + lineNumber + '\'' +
                ", message='" + message + '\'' +
                ", source='" + source + '\'' +
                ", exceptionStr='" + exceptionStr + '\'' +
                '}';
    }
}
